Skip to content

fix: throw IllegalArgumentException for malformed HMS times - #185

Merged
sargunv merged 1 commit into
mainfrom
cursor/hms-parse-intornull-82a1
Nov 16, 2026
Merged

sargunv merged 1 commit into
mainfrom
cursor/hms-parse-intornull-82a1

Conversation

@sargunv

@sargunv sargunv commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Description

Parse HMS components with toIntOrNull and require so ab:cd:ef raises the HH:MM:SS format IllegalArgumentException instead of NumberFormatException.

Validation

Ran HmsSerializersTest on JVM, JS, WASM, and Linux native, then mise run check and mise run build.

AI assistance

Cursor Grok 4.6 as a Cursor Cloud Agent.

Open in Web Open in Cursor 

parseHms now uses toIntOrNull and require so values like ab:cd:ef fail
with the HH:MM:SS format message instead of NumberFormatException.

Co-authored-by: Sargun Vohra <sargunv@users.noreply.github.com>
@sargunv
sargunv marked this pull request as ready for review November 16, 2026 03:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T03:07:52.833319Z 30d65d7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

parseHms now rejects malformed numeric components with IllegalArgumentException and the HH:MM:SS format message.

  • HMS time decoding reports nonnumeric parts as a format error.

Reviews (1) · Last reviewed commit: "fix: throw IllegalArgumentException for ..." · Reviewed by Greptile

@sargunv
sargunv merged commit 01f6ddf into main Nov 16, 2026
5 checks passed
@sargunv
sargunv deleted the cursor/hms-parse-intornull-82a1 branch November 16, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants